<?php

namespace App\Services;

use App\Models\Switchs;
use Slowlyo\OwlAdmin\Services\AdminService;

/**
 * 交换机管理
 *
 * @method Switchs getModel()
 * @method Switchs|\Illuminate\Database\Query\Builder query()
 */
class SwitchService extends AdminService
{
	protected string $modelName = Switchs::class;

	public function searchable($query)
	{
		parent::searchable($query);

		$query->when(filled($this->request->input('name')), fn($q) => $q->where('name', 'like', '%' . filled($this->request->input('交换机名称')) . '%'));
	}
}